package com.scau.yangsuiyu.estore.dababases.entity;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author suiyu_yang
 * @description
 * @date 2019-06-04 19:20
 * @email suiyu_yang@163.com
 */
public class ReviewPK implements Serializable {
    private int id;
    private int goodsId;

    @Column(name = "id")
    @Id
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(name = "goods_id")
    @Id
    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ReviewPK reviewPK = (ReviewPK) o;
        return id == reviewPK.id &&
                goodsId == reviewPK.goodsId;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, goodsId);
    }
}
